﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Report.ascx.cs" Inherits="Controls_Report" %>
<%if (listBook.Count > 0)
  {%>
<table class="TableBooks" id="tablepaging">
    <thead>
        <th class="Width80" style="color: white"><%= Language["Name"]%></th>
        <th class="Width150" style="color: white"><%= Language["Photo"]%></th>
        <th class="Width150" style="color: white"><%= Language["Categories"]%></th>
        <th class="Width100" style="color: white"><%= Language["Platform"]%></th>
        <%if (reportid == 1)
          { %>
        <th class="Width80" style="color: white"><%= Language["Downloaded"]%></th>
        <%}
          else if (reportid == 2)
          { %>
        <th class="Width80" style="color: white"><%= Language["Like"]%></th>
        <%}
          else
          { %>
        <th class="Width80" style="color: white"><%= Language["Downloaded"]%></th>
        <th class="Width80" style="color: white"><%= Language["Like"]%></th>
        <%} %>
    </thead>
    <tbody>
        <%
      for (int i = 0; i < listBook.Count; i = i + 1)
      {

          if (i % 2 == 0)
          {%>
        <tr class="Even">
            <td><%= listBook[i].Name%></td>
            <td><a href="../Home/BookDetail.aspx?bookid=<%= listBook[i].ID %>">
                <img src="..<%= listBook[i].Image %>" width="107px" height="147px"></a></td>
            <td><%= listBook[i].category.Name%></td>
            <td><%= ConvertPlatform(listBook[i].Details)%></td>
            <%if (reportid == 1)
              { %>
            <td><%= listBook[i].NumberOfDownload%></td>
            <%}
              else if (reportid == 2)
              { %>
            <td><%= listBook[i].NumberOfLike%></td>
            <%}
              else
              { %>
            <td><%= listBook[i].NumberOfDownload%></td>
            <td><%= listBook[i].NumberOfLike%></td>
            <%} %>
        </tr>
        <%
          }
          else
          {
        %>
        <tr class="Odd">
            <td><%= listBook[i].Name%></td>
            <td><a href="../Home/BookDetail.aspx?bookid=<%= listBook[i].ID %>">
                <img src="..<%= listBook[i].Image %>" width="107px" height="147px"></a></td>
            <td><%= listBook[i].category.Name%></td>
            <td><%= ConvertPlatform(listBook[i].Details)%></td>
            <%if (reportid == 1)
              { %>
            <td><%= listBook[i].NumberOfDownload%></td>
            <%}
              else if (reportid == 2)
              { %>
            <td><%= listBook[i].NumberOfLike%></td>
            <%}
              else
              { %>
            <td><%= listBook[i].NumberOfDownload%></td>
            <td><%= listBook[i].NumberOfLike%></td>
            <%} %>
        </tr>
        <%
          }
      }
        %>
    </tbody>
</table>
<%if (listBook.Count > 20) { %>
<div id="pageNavPosition" style="padding-top: 20px; text-align: left; float: left; width: 100%;" align="center"></div>
<script type="text/javascript">

    var pager = new Pager('tablepaging', 2);
    pager.init();
    pager.showPageNav('pager', 'pageNavPosition');
    pager.showPage(1);

</script>
<%} %>
<% }
  else
  {%>
<p class="NoResult">
    <%=Language["noresult"]%>
</p>
<%} %>